package org.roulette.model;

import java.util.ArrayList;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "field")
@XmlAccessorType(XmlAccessType.FIELD)
public class Field {

	private int index;
	private String name;
	@XmlElement
	private ArrayList<Bet> bets;

	public Field() {

	}

	public Field(int index, String name) {
		this.index = index;
		this.name = name;
		this.setBets(new ArrayList<Bet>());
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getName() {
		return name;
	}

	public void setName(String type) {
		this.name = type;
	}

	public ArrayList<Bet> getBets() {
		return bets;
	}

	public void setBets(ArrayList<Bet> bets) {
		this.bets = bets;
	}

	public Field addBet(Bet bet) {
		bets.add(bet);
		return this;
	}
	
	public void removeBets(){
		bets.clear();
	}

}
